<?php

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
		Route::any('login','LoginController@login');
		Route::get('code','LoginController@code');
		Route::get('crypt', 'LoginController@crypt');
});


Route::group(['namespace'=>'Home'],function(){
    Route::get('/', 'IndexController@index');
    Route::get('/cate/{cate_id}', 'IndexController@cate');
    Route::get('/a/{art_id}', 'IndexController@article');
});


 Route::group(['middleware'=>['adminlogin'],'prefix'=>'admin','namespace'=>'Admin'],function(){
      Route::get('index', 'IndexController@index');
      Route::get('info', 'IndexController@info');
      Route::get('quit', 'LoginController@quit');
      Route::any('pass', 'IndexController@pass');

      Route::post('cate/changeorder', 'CategoryController@changeOrder');
      Route::resource('category','CategoryController');
      Route::resource('article','ArticleController');


       Route::post('links/changeorder', 'LinksController@changeOrder');
       Route::resource('links', 'LinksController');

       Route::post('navs/changeorder', 'NavsController@changeOrder');
       Route::resource('navs', 'NavsController');

       Route::get('config/putfile', 'ConfigController@putFile');
       Route::post('config/changecontent', 'ConfigController@changeContent');
       Route::post('config/changeorder', 'ConfigController@changeOrder');
       Route::resource('config', 'ConfigController');
      Route::any('system', 'SystemController@index');
     Route::any('upload', 'BaseController@upload');
  });
